//
//  OO_HomeCell.m
//  ShopProject
//
//  Created by macbookpro on 2018/9/26.
//  Copyright © 2018年 ShopProject. All rights reserved.
//

#import "OO_HomeCell.h"

@implementation OO_HomeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setModel:(OO_GoodsModel *)model{
    _model = model;
    NSString *image1 = @"";
    NSString *image2 = @"";
    NSString *image3 = @"";
    if (model.image.count > 0) {
        image1 = model.image[0];
    }
    if (model.image.count > 1) {
        image2  = model.image[1];
    }
    if (model.image.count > 2) {
        image3 = model.image[2];
    }
    [self.imageView1 sd_setImageWithURL:[NSURL URLWithString:image1] placeholderImage:[UIImage imageNamed:IMAGEPLACEHOLDER]];
    [self.imageView2 sd_setImageWithURL:[NSURL URLWithString:image2] placeholderImage:[UIImage imageNamed:IMAGEPLACEHOLDER]];
    [self.imageView3 sd_setImageWithURL:[NSURL URLWithString:image3] placeholderImage:[UIImage imageNamed:IMAGEPLACEHOLDER]];
    
    self.nameLable.text = model.goodsName;
    self.numberLable.text = [NSString stringWithFormat:@"已售%ld",model.soldCount];
    self.moneyLable.text = [NSString stringWithFormat:@"¥%.2lf",model.price];
}
@end
